
/**
* ...
* @author $(DefaultUser)
*/

class com.mochimedia.ui.Event {
    
    private var _type:String;
    private var _callbackObj:Object;
    private var _callbackMethod:Function;
    
    public function get type():String { return _type; }
    public function get callbackObj():Object { return _callbackObj; }
    public function get callbackMethod():Function { return _callbackMethod; }
    
    public var target:Object;
    
    //
    //
    public function Event (type:String, callbackObj:Object, callbackMethod:Function) {

        _type = type;
        _callbackObj = callbackObj;
        _callbackMethod = callbackMethod;

    }
    
    //
    //
    public function dispatch (target:Object):Void {

        this.target = target;
        _callbackMethod.apply(_callbackObj, [this]);
        
    }
    
}